package com.cmy.IO;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

/**
 * @Author Void
 * @Description //TODO 使用 BufferedReader 在控制台读取字符
 * @Date 16:51 2021/3/5
 * @Param
 * @return
 **/
public class BRRead {
    public static void main(String[] args) throws IOException {
        char c;
        // 使用 System.in 创建 BufferedReader
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        System.out.println("输入字符,按下'q'退出");
        // 读取字符
        do{
            c = (char) br.read();
            System.out.println(c);
        }while (c!='q');
    }
}

    